import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    { path: '/login', component: () => import('@/views/login/LoginPage.vue') }, // 登录页
    {
      path: '/application',
      component: () => import('@/views/application/index.vue')
    },
    {
      path: '/',
      component: () => import('@/views/layout/index.vue'),
      redirect: '/volunteer',
      children: [
        {
          path: '/volunteer',
          component: () => import('@/views/volunteer/index.vue')
        },
        {
          path: '/training',
          component: () => import('@/views/training/index.vue')
        },
        {
          path: '/userManage',
          component: () => import('@/views/user/userManage/index.vue')
        },
        {
          path: '/carouselManage',
          component: () =>
            import('@/views/interfaceSetting/CarouselManage/index.vue')
        },
        {
          path: '/noticeManage',
          component: () =>
            import('@/views/interfaceSetting/NoticeManage/index.vue')
        }
      ]
    }
  ]
})

export default router
